<?php


class Hash
{
    
    /**
    * create hash
    * 
    * @param mixed $algo  (md5, sha1, etc)
    * @param mixed $data  the data to incode
    * @param mixed $salt  security key for encode
    * 
    * @return string hash 
    */
    public static function create($algo, $data, $salt)
    {
        $context = hash_init($algo, HASH_HMAC, $salt);
        hash_update($context, $data);
        return hash_final($context);
    }
    
}